<?php
include('config.php');
$uname=$_POST['uname'];
$upass=$_POST['upass'];
$sql="SELECT * FROM userdata WHERE name='$uname' AND password='$upass'";		
$sqlquery=mysql_query($sql);
$num_rows = mysql_num_rows($sqlquery);
while($row = mysql_fetch_assoc($sqlquery)) {
	$data[]=$row;
}
if($num_rows==1){
	echo json_encode($data);
}
else{
	echo json_encode($data);
}
//echo $uname."pass:".$upass;
mysql_close();
?>